package com.sy.service.impl;

import com.sy.dao.BrandDao;
import com.sy.dao.impl.BrandDaoImpl;
import com.sy.entity.Brand;
import com.sy.service.BrandService;

import java.util.ArrayList;
import java.util.List;

import static com.sy.constant.BusinessConstant.ALL_BRAND_ID;

public class BrandServiceImpl extends AbstractBaseServiceImpl implements BrandService {
    private BrandDao brandDao = new BrandDaoImpl();

    @Override
    public List<Brand> getAllBrands() {
        List<Brand> brands = new ArrayList<>();
        Brand allBrand = new Brand();
        allBrand.setId(ALL_BRAND_ID);
        allBrand.setName("全部");
        brands.add(allBrand);
        brands.addAll(brandDao.getAllBrands());
        return brands;
    }
}
